package operateur;

/**
 * Interface definition : TopologieRegions
 * 
 * @author OpenORB Compiler
 */
public class _TopologieRegionsStub extends org.omg.CORBA.portable.ObjectImpl
        implements TopologieRegions
{
    static final String[] _ids_list =
    {
        "IDL:operateur/TopologieRegions:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = operateur.TopologieRegionsOperations.class;

    /**
     * Operation getZoneFromAdress
     */
    public String getZoneFromAdress(String adresseUtil)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getZoneFromAdress",true);
                    operateur.adresseHelper.write(_output,adresseUtil);
                    _input = this._invoke(_output);
                    String _arg_ret = operateur.zoneHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getZoneFromAdress",_opsClass);
                if (_so == null)
                   continue;
                operateur.TopologieRegionsOperations _self = (operateur.TopologieRegionsOperations) _so.servant;
                try
                {
                    return _self.getZoneFromAdress( adresseUtil);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getProximite
     */
    public operateur.Proximite getProximite(String z1, String z2)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getProximite",true);
                    operateur.zoneHelper.write(_output,z1);
                    operateur.zoneHelper.write(_output,z2);
                    _input = this._invoke(_output);
                    operateur.Proximite _arg_ret = operateur.ProximiteHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getProximite",_opsClass);
                if (_so == null)
                   continue;
                operateur.TopologieRegionsOperations _self = (operateur.TopologieRegionsOperations) _so.servant;
                try
                {
                    return _self.getProximite( z1,  z2);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
